
class Alg<E extends Comparable<E>>{
    public E findMax(E[] array){
        for (int i = 0; i < array.length; i++) {
            if(array[0].compareTo(array[i]) < 0){
                array[0] = array[i];
            }
        }
        return array[0];
    }
}
class Alg2{
    public<E extends Comparable<E>> E findMax(E[] array){
        for (int i = 0; i < array.length; i++) {
            if(array[0].compareTo(array[i]) < 0){
                array[0] = array[i];
            }
        }
        return array[0];
    }
}
class Alg3{
    public static <E extends Comparable<E>> E findMax(E[] array){
        for (int i = 0; i < array.length; i++) {
            if(array[0].compareTo(array[i]) < 0){
                array[0] = array[i];
            }
        }
        return array[0];
    }
}
public class Test2 {
    public static void main(String[] args) {
        Alg<Integer> alg = new Alg<Integer>();
        Integer[] arr = {1,3,11,7,9,55,32,17,82,99};
        Integer val = alg.findMax(arr);
        System.out.println(val);

        Alg2 alg2 = new Alg2();
        Integer val2 = alg2.<Integer>findMax(arr);
        System.out.println(val2);

        Integer val3 = Alg3.findMax(arr);
        System.out.println(val3);
    }
}
